package JAVA300.第十一章多线程;

/**
 * 创建线程方式二 实现接口
 */
public class thread_04_startByImplement implements Runnable{

    @Override
    public void run() {
        for (int i= 0;i<10;i++){
            System.out.println("this is thread"+i);
        }
    }

    public static void main(String[] args) {

       //创建实现类对象
//        thread_04_startByImplement threadStart = new thread_04_startByImplement();
//        new Thread(threadStart).start();
//
        new Thread(new thread_04_startByImplement()).start();

        for (int i= 0;i<10;i++){
            System.out.println("this is main"+i);//无规律的交替进行
        }
    }
}
